package com.wqz.service.impl;

import com.wqz.pojo.Commodity;
import com.wqz.service.CommodityService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

import static org.junit.Assert.*;

public class CommodityServiceImplTest {

    @Test
    public void findCommodityList() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-mybatis.xml");
        CommodityService userService =  (CommodityService)applicationContext.getBean("commodityServiceImpl");
        try {
            List<Commodity> commodityList=userService.findCommodityList();
            System.out.println(commodityList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}